<style type="text/css">
body {
	font-size: 11px;
	font-family: arial, verdana;
}
.page_list {
	height: 200px;
	overflow: auto;
}
.risk-1-high {
	color: #cc0000;
}
.risk-2-medium {
	color: #cccc00;
}
.risk-3-low {
	color: #00cc00;
}
</style>

<form action="" method="post">
  <?php echo $add_form->renderHiddenFields(true); ?>
  <?php echo $add_form["url"]->render(); ?>
  <input type="submit" value="submit" name="submit" />
</form>

<?php foreach ($sites as $site): ?>
<div class="site" rel="<?php echo $site->getId(); ?>">
  <h2><?php echo $site->getUrl(); ?></h2>
</div>
<?php endforeach; ?>

<script type="text/javascript">
$(function (){
	$('.site').each(function (){
		var self = $(this);
		var get_site = '<?php echo url_for("@get_site"); ?>';
		$.getJSON(get_site+"?site_id="+$(this).attr("rel"), function (data){
			var ul = $('<ul />').addClass("page_list");
			$.each(data, function(){
				ul.append($('<li />').html(this.url).addClass('risk-'+this.risk));
			});
			self.append(ul);
		});

	});
});
</script>